import Vue from 'vue'
import App from './App.vue'
import router from './router'
import ZkTable from 'vue-table-with-tree-grid'
import VueQuillEditor from 'vue-quill-editor'

// require styles
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'



//组件按需导入
import { Input } from 'element-ui'
import { Button,Form } from 'element-ui';
import { FormItem } from 'element-ui';
import { Message, Container, Header, Aside, Main } from 'element-ui';
import { Menu, Submenu, MenuItem, MenuItemGroup} from 'element-ui';
import { Breadcrumb, Card } from 'element-ui';
import { BreadcrumbItem } from 'element-ui';
import { Row,Col } from 'element-ui'
import { TableColumn,Table } from 'element-ui'
import { Switch } from 'element-ui'
import { Tooltip, Pagination, Dialog } from 'element-ui'
import { MessageBox, Tag, Tree, Select, Option } from 'element-ui';
import { Cascader, Alert, Tabs, TabPane, Step, Steps, CheckboxGroup, Checkbox, Upload} from 'element-ui';




Vue.use(VueQuillEditor)
Vue.component('tree-table', ZkTable)


import '../font_/iconfont.css'

import axios from 'axios'

//配置请求根路径
axios.defaults.baseURL = 'http://127.0.0.1:8888/api/private/v1/'
Vue.prototype.axios=axios

Vue.prototype.$confirm = MessageBox.confirm


Vue.use(Upload)
Vue.use(Checkbox)
Vue.use(CheckboxGroup)
Vue.use(Step)
Vue.use(Steps)
Vue.use(TabPane)
Vue.use(Tabs)
Vue.use(Alert)
Vue.use(Cascader)
Vue.use(Option)
Vue.use(Select)
Vue.use(Tree)
Vue.use(Tag)
Vue.use(Menu)
Vue.use(Submenu)
Vue.use(MenuItem)
Vue.use(MenuItemGroup)
Vue.use(Header)
Vue.use(Aside)
Vue.use(Main)
Vue.use(FormItem)
Vue.use(Container)
Vue.use(Form)
Vue.use(Button)
Vue.use(Breadcrumb)
Vue.use(BreadcrumbItem)
Vue.use(Card)
Vue.use(Input)
Vue.use(Row)
Vue.use(Col)
Vue.use(Table)
Vue.use(TableColumn)
Vue.use(Switch)
Vue.use(Tooltip)
Vue.use(Pagination)
Vue.use(Dialog)
Vue.prototype.$message=Message


//导入全局样式
import './assets/css/global.css'





Vue.config.productionTip = false


Vue.filter("dateFormat",function(originVal){
  const dt = new Date(originVal)

  const y = dt.getFullYear()
  const m = (dt.getMonth() + 1 + '').padStart(2,'0')
  const d = (dt.getDate() + '').padStart(2, '0')

  const hh = (dt.getHours() + '').padStart(2,'0')
  const mm = (dt.getMinutes() + "").padStart(2,'0')
  const ss = (dt.getSeconds() + "").padStart(2, '0')

  return `${y}-${m}-${d} ${hh}:${mm}:${ss}`
})



axios.interceptors.request.use(config=>{
    config.headers.Authorization=window.sessionStorage.getItem('token')
    return config
})


new Vue({
  router,
  render: h => h(App)
}).$mount('#app')
